home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / pine / imap2bis-draft-01.txt < prev    next >
Encoding:
Text File  |  1993-08-13  |  95.1 KB  |  2,579 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                       Mark Crispin
  8. Internet Draft: IMAP2bis                        University of Washington
  9. Obsoletes: RFC 1176, 1064                                    August 1993
  10.  
  11.  
  12.             INTERACTIVE MAIL ACCESS PROTOCOL - VERSION 2bis
  13.  
  14.  
  15. Status of this Memo
  16.  
  17.    This document is an Internet Draft.  Internet Drafts are working
  18.    documents of the Internet Engineering Task Force (IETF), its Areas,
  19.    and its Working Groups. Note that other groups may also distribute
  20.    working documents as Internet Drafts.
  21.  
  22.    Internet Drafts are draft documents valid for a maximum of six
  23.    months.  Internet Drafts may be updated, replaced, or obsoleted by
  24.    other documents at any time.  It is not appropriate to use Internet
  25.    Drafts as reference material or to cite them other than as a "working
  26.    draft" or "work in progress."  Please check the I-D abstract listing
  27.    contained in each Internet Draft directory to learn the current
  28.    status of any this or any other Internet Draft.
  29.  
  30.    This draft document will be submitted to the RFC editor as a Proposed
  31.    Standard for the Internet Community.  Discussion and suggestions for
  32.    improvement are requested.  This document will expire before 31
  33.    December 1993.  Distribution of this draft is unlimited.  Comments
  34.    are solicited and should be sent to imap@CAC.Washington.EDU.
  35.  
  36.  
  37. Introduction
  38.  
  39.    The Interactive Mail Access Protocol, Version 2bis (IMAP2bis) allows
  40.    a client to access and manipulate electronic mail on a server.
  41.    IMAP2bis is designed to permit manipulations of remote mailboxes as
  42.    if they were local.  IMAP2bis includes operations for creating,
  43.    deleting, and renaming mailbox folders; checking for new mail;
  44.    permanently removing messages; setting and clearing flags; RFC 822
  45.    and MIME parsing; searching; and selective fetching of message
  46.    attributes, texts, and portions thereof.
  47.  
  48.    IMAP2bis does not specify a means of posting mail; this function is
  49.    handled by a mail transfer protocol such as SMTP (RFC 821).
  50.  
  51.    IMAP2bis assumes a reliable data stream such as provided by TCP.
  52.    When TCP is used, an IMAP2bis server listens on port 143.
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Crispin                                                         [Page 1]
  59.  
  60. Internet Draft                  IMAP2bis                 August 13, 1993
  61.  
  62.  
  63. System Model and Philosophy
  64.  
  65.    There are three fundamental models of client/server email: offline,
  66.    online, and disconnected use.  IMAP2bis can be used in any one of
  67.    these three models.
  68.  
  69.    The offline model is the most familiar form of client/server email
  70.    today, and is used by protocols such as POP-3 (RFC 1225) and UUCP.
  71.    In this model, a client application periodically connects to a
  72.    server.  It downloads all of the pending messages to the client
  73.    machine and deletes these from the server.  Thereafter, all mail
  74.    processing is local to the client.  This model is store-and-forward;
  75.    it moves mail on demand from an intermediate server (maildrop) to a
  76.    single destination machine.
  77.  
  78.    The online model is most commonly used with remote filesystem
  79.    protocols such as NFS.  In this model, a client application
  80.    manipulates mailbox data on a server machine.  A connection to the
  81.    server is maintained throughout the entire session.  No mailbox data
  82.    is kept on the client; the client retrieves data from the server as
  83.    is needed.  IMAP2bis introduces a form of the online model which
  84.    requires considerably less network bandwidth than a remote filesystem
  85.    protocol, and provides the opportunity for using the server for CPU
  86.    or I/O intensive functions such as parsing and searching.
  87.  
  88.    The disconnected use model is a hybrid of the offline and online
  89.    models, and is used by protocols such as PCMAIL (RFC 1056).  In this
  90.    model, a client user downloads some set of messages from the server,
  91.    manipulates them offline, then at some later time uploads the
  92.    changes.  The server remains the authoritative repository of the
  93.    messages.  The problems of synchronization (particularly when
  94.    multiple clients are involved) are handled through the means of
  95.    unique identifiers for each message.
  96.  
  97.    Each of these models have their own strengths and weaknesses, as
  98.    shown in the following table:
  99.  
  100.       Feature                               Offline Online  Disc
  101.       -------                               ------- ------  ----
  102.       Can use multiple clients               NO      YES     YES
  103.       Minimum use of server connect time     YES     NO      YES
  104.       Minimum use of server resources        YES     NO      NO
  105.       Minimum use of client disk resources   NO      YES     NO
  106.       Multiple remote mailboxes              NO      YES     YES
  107.       Fast startup                           NO      YES     NO
  108.       Mail processing when not online        YES     NO      YES
  109.  
  110.    Although IMAP2bis was originally designed to accommodate the online
  111.  
  112.  
  113.  
  114. Crispin                                                         [Page 2]
  115.  
  116. Internet Draft                  IMAP2bis                 August 13, 1993
  117.  
  118.  
  119.    model, it can support the other two models as well.  This makes
  120.    possible the creation of clients which can be used in any of the
  121.    three models.  For example, a user may wish to switch between the
  122.    online and disconnected models on a regular basis (e.g. due to
  123.    travel).
  124.  
  125.    IMAP2bis is designed to transmit message data on demand, and to
  126.    provide the facilities necessary for a client to make an intelligent
  127.    decision on what data it needs at any particular time.  There is
  128.    generally no need to do a wholesale transfer of an entire mailbox or
  129.    even of the complete text of a message.  This makes a difference in
  130.    situations where the mailbox is large, or when the link to the server
  131.    is slow.
  132.  
  133.    More specifically, IMAP2bis provides the capability of server-based
  134.    RFC 822 and MIME processing.  With this information, it is possible
  135.    for a client to determine in advance whether or not it wishes to
  136.    retrieve a particular message or part of a message.  For example, a
  137.    user connected to an IMAP2bis server via a dialup link can determine
  138.    that a message has a 2000 byte text segment and a 40 megabyte video
  139.    segment, and elect to fetch only the text segment.
  140.  
  141.    In IMAP2bis, the client/server relationship lasts only for the
  142.    duration of the TCP connection, and mailbox state is maintained on
  143.    the server.  There is no registration of clients.  With the possible
  144.    exception of unique identifiers used in disconnected use operation,
  145.    the client initially has no knowledge of mailbox state and learns it
  146.    from the IMAP2bis server when a mailbox is selected.  This initial
  147.    transfer is minimal; the client requests additional state data as it
  148.    needs it.
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Crispin                                                         [Page 3]
  171.  
  172. Internet Draft                  IMAP2bis                 August 13, 1993
  173.  
  174.  
  175. The Protocol
  176.  
  177.    The IMAP2bis protocol consists of a sequence of client commands and
  178.    server responses, with server data interspersed between the
  179.    responses.  Unlike most Internet protocols, commands and responses
  180.    are tagged.  That is, a command begins with a unique identifier
  181.    (typically a short alphanumeric sequence such as a Lisp "gensym"
  182.    function would generate e.g., A0001, A0002, etc.) called a tag.  The
  183.    response to the command is given the same tag from the server.
  184.  
  185.    Additionally, the server may send an arbitrary amount of "unsolicited
  186.    data", which is identified by the special reserved tag of "*".  The
  187.    unsolicited data mechanism is used to transmit most data in IMAP2bis.
  188.    The term "unsolicited data" refers to the fact that the data may have
  189.    been transmitted without any explicit request by the client for that
  190.    data.  No distinction is made in IMAP2bis between data transmitted as
  191.    a result of a client command and data which is unilaterally
  192.    transmitted by the server.  One form of unilaterally transmitted data
  193.    which commonly occurs is an alert of a change to the mailbox made by
  194.    some process other than the IMAP2bis client or server; for example,
  195.    changes in the size of the mailbox (new mail) or in the status of
  196.    individual messages.
  197.  
  198.    There is another special reserved tag, "+", discussed below.
  199.  
  200.    The server must be listening for a connection.  When a connection is
  201.    opened the server sends a greeting message and then waits for
  202.    commands.  This greeting is either a PREAUTH (meaning that the user
  203.    has already been identified and authenticated by an external
  204.    mechanism such as rsh) or OK (meaning that the user is not yet
  205.    authenticated) unsolicited response.  The server may also send a BYE
  206.    unsolicited response and close the connection if it rejects the
  207.    connection.
  208.  
  209.    The client opens a connection and waits for the greeting.  The client
  210.    must not send any commands until it has received the greeting from
  211.    the server.
  212.  
  213.    Once the greeting has been received, the client may begin sending
  214.    commands.  It is not under any obligation to wait for a server
  215.    response to a command before sending another command, subject to the
  216.    constraints of underlying flow control.  When commands are received
  217.    the server acts on them and responds with command responses, often
  218.    interspersed with data.
  219.  
  220.    In general, the command responses do not themselves contain the
  221.    requested data, but rather indicate the completion status of the
  222.    request.  There are three fundamental responses: success (OK), error
  223.  
  224.  
  225.  
  226. Crispin                                                         [Page 4]
  227.  
  228. Internet Draft                  IMAP2bis                 August 13, 1993
  229.  
  230.  
  231.    (NO), request faulty or not understood (BAD).  The effect of a
  232.    command can not be considered complete until a command response with
  233.    a tag matching the command is received from the server.
  234.  
  235.    It is not required that a server process a command to completion
  236.    before beginning processing of the next command, except when the
  237.    processing of the previous command may affect the results of the next
  238.    command by changing the state of the current mailbox.  This has
  239.    certain other effects; for example, this implies that an EXPUNGE
  240.    response can not be transmitted as part of a response to a request
  241.    that may be streamed with another response.
  242.  
  243.    If authentication has not yet been completed, it must now be done via
  244.    the LOGIN command before any IMAP2bis commands are permitted.  The
  245.    only other permitted command prior to successful authentication is
  246.    LOGOUT.  See the section below on authentication.
  247.  
  248.    Once authenticated, the client must send a mailbox selection command
  249.    to access the desired mailbox; no mailbox is selected by default.
  250.    Mailbox names are implementation dependent.  However, the word
  251.    "INBOX" must be implemented to mean the primary or default mailbox
  252.    for this user, independent of any other server semantics.  It is
  253.    permitted for a server not to have an INBOX if there is no concept of
  254.    a primary or default mailbox for this user.  The name "INBOX" MUST
  255.    NOT be used for any other purpose.
  256.  
  257.    On a successful selection, the server will send a list of valid
  258.    flags, number of messages, and number of messages arrived since last
  259.    access for this mailbox as unsolicited data, followed by an OK
  260.    response.  The client may terminate access to this mailbox and access
  261.    a different one with another selection command.
  262.  
  263.    The client requests mailbox data with FETCH commands, and receives it
  264.    via the unsolicited data mechanism.  Three major categories of
  265.    mailbox data exist.
  266.  
  267.    The first category is data that is associated with a message as an
  268.    entity in the mailbox.  There are now four such items of data: the
  269.    "internal date", the "RFC 822 size", the "flags", and the "unique
  270.    id".  The internal date is the date and time that the message was
  271.    placed in the mailbox.  The RFC 822 size is the size in bytes of the
  272.    message, expressed as an RFC 822 text string.  The flags are a list
  273.    of status flags associated with the message.  The unique id is an
  274.    identifier which is guaranteed to refer to this message and to none
  275.    other and which, unlike IMAP2bis sequence numbers, persists across
  276.    sessions.
  277.  
  278.    The second category is data that describes the composition and
  279.  
  280.  
  281.  
  282. Crispin                                                         [Page 5]
  283.  
  284. Internet Draft                  IMAP2bis                 August 13, 1993
  285.  
  286.  
  287.    delivery information of a message; that is, information such as the
  288.    message sender, recipient lists, message-ID, subject, MIME structure,
  289.    etc.  This is the information that is stored in the RFC 822 and MIME
  290.    headers.  In IMAP2bis, the RFC 822 header information that may be
  291.    fetched is called the "envelope" (not to be confused with SMTP
  292.    envelopes).  Similarly, the MIME header information that may be
  293.    fetched is called the "body".  A client can use the parsed envelope
  294.    and body and not worry about having to do its own RFC 822 or MIME
  295.    parsing.
  296.  
  297.    The third category is textual data, some of which is intended for
  298.    direct human viewing.  IMAP2bis defines six such items:
  299.    RFC822.HEADER, RFC822.HEADER.LINES, RFC822.HEADER.LINES.NOT,
  300.    RFC822.TEXT, RFC822, and MIME body parts.  It is possible to fetch an
  301.    individual MIME body part of a message without fetching any other
  302.    data associated with the message.
  303.  
  304.    In the simplest case, a client can "FETCH RFC822" to get the entire
  305.    message without any processing.  A more sophisticated client might
  306.    fetch some combination of the first and second categories of data for
  307.    use as a presentation menu.  Then, when the user wishes to read a
  308.    particular message, it will fetch the appropriate texts.
  309.  
  310.    Data structures in IMAP2bis are represented as an S-expression list
  311.    similar to that used in the Lisp programming language.  An S-
  312.    expression consists of a sequence of data items delimited by space
  313.    and bounded at each end by parentheses.  An S-expression may itself
  314.    contain other S-expressions, using parentheses to indicate nesting.
  315.    S-expression syntax was chosen because it provides a concise and
  316.    precise means of expressing nested data (e.g. MIME structure).
  317.  
  318.    The client can alter certain data with a STORE command.  As an
  319.    example, a message is deleted from a mailbox by setting the \DELETED
  320.    flag with a STORE command.
  321.  
  322.    Other client operations that can be done to a mailbox include copying
  323.    messages to other mailboxes, permanently removing deleted messages,
  324.    checking for updated mailbox state, and searching for messages that
  325.    match certain criteria.  It is also possible to select different
  326.    mailboxes, create a new mailbox, and rename or delete an existing
  327.    mailbox.
  328.  
  329.    The client should terminate the session with the LOGOUT command.  The
  330.    server returns a "BYE" followed by an "OK", at which point both the
  331.    client and the server close the connection.  If the client closes the
  332.    network connection without a LOGOUT command, the server should
  333.    perform its normal logout procedures without attempting any further
  334.    interaction with the client.
  335.  
  336.  
  337.  
  338. Crispin                                                         [Page 6]
  339.  
  340. Internet Draft                  IMAP2bis                 August 13, 1993
  341.  
  342.  
  343. Authentication
  344.  
  345.    Pre-authentication is only possible when the connection to the
  346.    IMAP2bis service is made through some link protocol which provides
  347.    its own authentication mechanism.  It is not used with a TCP
  348.    connection to port 143.
  349.  
  350.    An example of pre-authentication is the BSD "RSH" protocol which
  351.    provides authentication through a "trusted host" facility.  Another
  352.    example would be a manual invocation of an IMAP2bis server from a
  353.    logged-in timesharing job.
  354.  
  355.    A pre-authenticated IMAP2bis server should recognize that
  356.    authentication has already happened, and enter the post-login state.
  357.    In its greeting message, it should use the unsolicited response
  358.    "PREAUTH" instead of "OK" to indicate that external authentication
  359.    has taken place.
  360.  
  361.    This is an example of a pre-authentication scenario.  In this and all
  362.    other examples in this document, S: indicates server dialog and C:
  363.    indicates client dialog.
  364.  
  365.            S: * PREAUTH IMAP2bis Server pre-authenticated as user "Smith"
  366.            C: A001 SELECT INBOX
  367.            S: * FLAGS (\Answered \Flagged \Deleted \Seen)
  368.            S: * 19 EXISTS
  369.            S: * 2 RECENT
  370.            S: A001 OK SELECT complete
  371.  
  372.    A connection that is not pre-authenticated is constrained to using
  373.    the LOGIN command for establishing authentication.  Authentication
  374.    via the LOGIN command is with either a user name and password pair,
  375.    or with an user identifier and Kerberos authenticator.  See the
  376.    description of the LOGIN command for more details.
  377.  
  378.    Servers may allow non-authenticated access to certain mailboxes or
  379.    bulletin boards.  By convention, this is accomplished with a LOGIN
  380.    command using the userid "anonymous".  A password is still required.
  381.    It is implementation-dependent what requirements, if any, are placed
  382.    upon the password and what access restrictions are placed on
  383.    anonymous users.
  384.  
  385.    Implementations are NOT required to support pre-authentication,
  386.    Kerberos authentication, or the anonymous convention in order to be
  387.    considered IMAP2bis compliant.
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Crispin                                                         [Page 7]
  395.  
  396. Internet Draft                  IMAP2bis                 August 13, 1993
  397.  
  398.  
  399. Definitions of Commands and Responses
  400.  
  401.      Summary of Defined Commands and Responses
  402.  
  403.        Commands                            ||  Responses
  404.        --------                            ||  -------
  405.        tag NOOP                            ||  tag OK response_text
  406.        tag LOGIN user password             ||  tag NO response_text
  407.        tag LOGOUT                          ||  tag BAD response_text
  408.        tag CREATE mailbox                  ||  * PREAUTH response_text
  409.        tag DELETE mailbox                  ||  * OK response_text
  410.        tag RENAME old_mailbox new_mailbox  ||  * NO response_text
  411.        tag FIND MAILBOXES pattern          ||  * BAD response_text
  412.        tag FIND ALL.MAILBOXES pattern      ||  * BYE response_text
  413.        tag FIND BBOARDS pattern            ||  * MAILBOX mstring
  414.        tag FIND ALL.BBOARDS pattern        ||  * BBOARD mstring
  415.        tag SUBSCRIBE MAILBOX mailbox       ||  * SEARCH 1#number
  416.        tag UNSUBSCRIBE MAILBOX mailbox     ||  * FLAGS flag_list
  417.        tag SUBSCRIBE BBOARD mailbox        ||  * number EXISTS
  418.        tag UNSUBSCRIBE BBOARD mailbox      ||  * number RECENT
  419.        tag SELECT mailbox                  ||  * number EXPUNGE
  420.        tag EXAMINE mailbox                 ||  * number FETCH data
  421.        tag BBOARD mailbox                  ||  * number COPY
  422.        tag CHECK                           ||  * number STORE data
  423.        tag EXPUNGE                         ||  + text
  424.        tag COPY sequence mailbox           ||
  425.        tag APPEND mailbox string           ||
  426.        tag FETCH sequence data             ||
  427.        tag PARTIAL msgno data start count  ||
  428.        tag STORE sequence data value       ||
  429.        tag UID AFTER uniqueid              ||
  430.        tag UID BEFORE uniqueid             ||
  431.        tag UID COPY sequence mailbox       ||
  432.        tag UID FETCH sequence data         ||
  433.        tag UID STORE sequence data value   ||
  434.        tag SEARCH search_program           ||
  435.        tag x_command arguments             ||
  436.  
  437.    Note: there is no pairing between commands and responses on the same
  438.    line.  Any command may result in any number (including none at all)
  439.    of any of responses beginning with "*" (referred to as "unsolicited
  440.    data"), followed by one tagged response.
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Crispin                                                         [Page 8]
  451.  
  452. Internet Draft                  IMAP2bis                 August 13, 1993
  453.  
  454.  
  455. Commands
  456.  
  457.    Certain commands and facilities described below are listed as
  458.    "optional".  This term is used to identify server capabilities which
  459.    may not be present in a minimal server implementation or a server
  460.    implementation based upon an older version of this specification.
  461.    Such a server is considered to be IMAP2bis compatible (but not
  462.    necessarily compliant) if it implements all commands which are not
  463.    labeled as "optional".
  464.  
  465.    An IMAP2bis compliant server implementation MUST implement all of the
  466.    commands and facilities listed below, whether or not they are
  467.    labelled as "optional".
  468.  
  469.    An IMAP2bis compliant client MUST be prepared to accept BAD as a
  470.    response to any of the optional commands or facilities, and
  471.    substitute alternate or default action in that case.
  472.  
  473.    If, during the execution of any command, the server observes that the
  474.    mailbox size has changed, the server should output an unsolicited
  475.    EXISTS and RECENT response reflecting the changed size to alert the
  476.    client.  Similarly, any observed change in message status should
  477.    cause an unsolicited FETCH response with the new flag data.
  478.  
  479.  
  480.    tag NOOP
  481.  
  482.       The NOOP command returns an OK to the client.  By itself, it does
  483.       nothing else.  However, since any command can return a status
  484.       update as unsolicited data, this command can be used to poll for
  485.       new mail or for message status updates.
  486.  
  487.       Another possible use of this command is for the client to "ping"
  488.       the server so that the client and server know that each other are
  489.       still alive.  This is useful with servers that have an inactivity
  490.       autologout timer.
  491.  
  492.  
  493.    tag LOGIN user password
  494.  
  495.       The LOGIN command identifies the user to the server and carries
  496.       the password authenticating this user.  This information is used
  497.       by the server to control access to the mailboxes.
  498.  
  499.       EXAMPLE:  a001 LOGIN SMITH SESAME
  500.       logs in as user SMITH with password SESAME.
  501.  
  502.       If a server supports authentication via Kerberos, it may accept
  503.  
  504.  
  505.  
  506. Crispin                                                         [Page 9]
  507.  
  508. Internet Draft                  IMAP2bis                 August 13, 1993
  509.  
  510.  
  511.       the string "@KERBEROS:" followed by the hexadecimal representation
  512.       of a Kerberos authenticator.
  513.  
  514.       EXAMPLE: The following is a Kerberos login scenario (note that the
  515.       line breaks in the sample authenticator are for editorial clarity
  516.       and are not in a real authenticator):
  517.  
  518.          S: * OK Kerberos IMAP2bis Server
  519.          C: a001 LOGIN smith @KERBEROS:040700414e445245572e434d552e4544550
  520.             038202c868f3890b377fc8266acc1bedb96b80d3fa76489898e74cd1c952dc
  521.             4003ea3428f29f1c470016cf5adc22f939e6deff2747254c1815d5b0b90d4c
  522.             5a2cba21eb0abe32f9acbf568d751bf4cc13f5ba4e6d82c638a8b5421
  523.          S: a001 OK [df84a4cb8323454f] Login OK via Kerberos
  524.  
  525.       The token in the brackets in the OK response is the Kerberos
  526.       authentication response, encrypted with the session key in network
  527.       byte order and an incremented checksum as in the usual Kerberos
  528.       procedure.
  529.  
  530.  
  531.    tag LOGOUT
  532.  
  533.       The LOGOUT command informs the server that the client is done with
  534.       the session.  The server should send an unsolicited BYE response
  535.       before the (tagged) OK response, and then close the network
  536.       connection.
  537.  
  538.  
  539.    Mailbox manipulation commands: CREATE, DELETE, RENAME
  540.  
  541.    These commands permit the manipulation of entire mailboxes.  Server
  542.    support for mailbox manipulation commands is optional.
  543.  
  544.       tag CREATE mailbox
  545.  
  546.          The CREATE command creates a mailbox with the given name.  This
  547.          command returns an OK response only if a new mailbox with that
  548.          name has been created.  It is an error to attempt to create a
  549.          mailbox with a name that refers to an extant mailbox.  Any
  550.          error in creation will return a NO response.
  551.  
  552.          Creating INBOX is not permitted.  If there is a primary or
  553.          default mailbox for this user, it MUST exist and be called
  554.          INBOX.
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Crispin                                                        [Page 10]
  563.  
  564. Internet Draft                  IMAP2bis                 August 13, 1993
  565.  
  566.  
  567.       tag DELETE mailbox
  568.  
  569.          The DELETE command deletes a mailbox with the given name.  This
  570.          command returns an OK response only if a mailbox with that name
  571.          has been deleted.  It is an error to attempt to delete a
  572.          mailbox name that does not exist.  Any error in deletion will
  573.          return a NO response.
  574.  
  575.          A server SHOULD NOT attempt to test that a mailbox is empty
  576.          prior to permitting deletion; this would prevent the deletion
  577.          of a mailbox which for some reason can not be opened or
  578.          expunged, leaving to possible denial of service problems.  Any
  579.          such checking should be left to the discretion of the client.
  580.  
  581.          Deleting INBOX is not permitted.
  582.  
  583.  
  584.       tag RENAME old_mailbox new_mailbox
  585.  
  586.          The RENAME command changes the name of a mailbox.  This command
  587.          returns an OK response only if a mailbox with the old name
  588.          exists and has been successfully renamed to the new name.  It
  589.          is an error to attempt to rename with an old mailbox name that
  590.          does not exist or a new mailbox name which already exists.  Any
  591.          error in renaming will return a NO response.
  592.  
  593.          Renaming INBOX is permitted.  A new, empty INBOX is created in
  594.          its place.
  595.  
  596.  
  597.    FIND commands
  598.  
  599.    The FIND commands return some set of unsolicited MAILBOX or BBOARD
  600.    replies, depending upon the type of FIND, that have as their value a
  601.    single mailbox name.
  602.  
  603.    Three wildcard characters are defined in the pattern argument.  "*"
  604.    specifies any number (including zero) characters may match at this
  605.    position.  "%" and "?"  specify a single character may match at this
  606.    position.  For example, FOO*BAR will match FOOBAR, FOOD.ON.THE.BAR
  607.    and FOO.BAR, whereas FOO%BAR and FOO?BAR match only FOO.BAR.  "*"
  608.    will match all mailboxes.
  609.  
  610.    Server support for all forms of FIND is optional.  If a FIND command
  611.    returns BAD as a response then the client can make no assumptions
  612.    about what mailboxes exist on the server.
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Crispin                                                        [Page 11]
  619.  
  620. Internet Draft                  IMAP2bis                 August 13, 1993
  621.  
  622.  
  623.       tag FIND MAILBOXES pattern
  624.  
  625.          The FIND MAILBOXES command accepts as an argument a pattern
  626.          (including wildcards) that specifies some set of mailbox names
  627.          that the user has declared as being "active" or "subscribed."
  628.          The exact meaning of this is implementation-dependent, since
  629.          the concept of a set of "active" or "subscribed" mailboxes that
  630.          is preserved across sessions may not be meaningful for a
  631.          particular server or server implementation.  If the SUBSCRIBE
  632.          MAILBOX and UNSUBSCRIBE MAILBOX commands are implemented then
  633.          this command returns the list manipulated by those commands.
  634.  
  635.          EXAMPLE:  C: A002 FIND MAILBOXES *
  636.                    S: * MAILBOX FOOBAR
  637.                    S: * MAILBOX GENERAL
  638.                    S: A002 OK FIND completed
  639.  
  640.  
  641.       tag FIND ALL.MAILBOXES pattern
  642.  
  643.          The FIND ALL.MAILBOXES command is similar to FIND MAILBOXES;
  644.          however, it should return a complete list of all mailboxes
  645.          available to the user.  Data is returned as in FIND MAILBOXES.
  646.  
  647.          The special name INBOX is included in the output from FIND
  648.          ALL.MAILBOXES unless INBOX is not supported by this server or
  649.          for this user.  The criteria for omitting INBOX is whether or
  650.          not SELECT INBOX will return failure; it is not relevant
  651.          whether or not the user's actual INBOX resides on this or some
  652.          other server.  FIND MAILBOXES and SUBSCRIBE MAILBOX provide a
  653.          mechanism for the user to identify that this is his or her real
  654.          INBOX.
  655.  
  656.          If FIND ALL.MAILBOXES is implemented FIND MAILBOXES must also
  657.          be implemented, even if it returns the same information.  Also,
  658.          FIND ALL.MAILBOXES must, at least, return all the mailbox names
  659.          that are returned by FIND MAILBOXES.
  660.  
  661.          The exact meaning of this is implementation-dependent, since
  662.          the concept of a bounded or deterministic set of "mailboxes
  663.          available to the user" may not be meaningful for a particular
  664.          server or server implementation.
  665.  
  666.  
  667.       tag FIND BBOARDS pattern
  668.  
  669.          The FIND BBOARDS command accepts as an argument a pattern that
  670.          specifies some set of bulletin board names that the user has
  671.  
  672.  
  673.  
  674. Crispin                                                        [Page 12]
  675.  
  676. Internet Draft                  IMAP2bis                 August 13, 1993
  677.  
  678.  
  679.          declared as being "active" or "subscribed."  Wildcards are
  680.          permitted as in FIND MAILBOXES.
  681.  
  682.          The FIND BBOARDS command will return some set of unsolicited
  683.          BBOARD replies that have as their value a single bulletin board
  684.          name.
  685.  
  686.          EXAMPLE:  C: A002 FIND BBOARDS *
  687.                    S: * BBOARD FOOBAR
  688.                    S: * BBOARD GENERAL
  689.                    S: A002 OK FIND completed
  690.  
  691.          The exact meaning of this is implementation-dependent, since
  692.          the concept of a set of "active" or "subscribed" bboards that
  693.          is preserved across sessions may not be meaningful for a
  694.          particular server or server implementation.  If the SUBSCRIBE
  695.          BBOARD and UNSUBSCRIBE BBOARD commands are implemented then
  696.          this command returns the list manipulated by those commands.
  697.  
  698.  
  699.       tag FIND ALL.BBOARDS pattern
  700.  
  701.          The FIND ALL.BBOARDS command is similar to FIND BBOARDS;
  702.          however, it should return a complete list of all bulletin
  703.          boards available to the user.  Data is returned as in FIND
  704.          BBOARDS.
  705.  
  706.          If FIND ALL.BBOARDS is implemented FIND BBOARDS must also be
  707.          implemented, even if it returns the same information.  Also,
  708.          FIND ALL.BBOARDS must, at least, return all the bboard names
  709.          that are returned by FIND BBOARDS.
  710.  
  711.          The exact meaning of this is implementation-dependent, since
  712.          the concept of a bounded or deterministic set of "bboards
  713.          available to the user" may not be meaningful for a particular
  714.          server or server implementation.
  715.  
  716.  
  717.    Subscription commands
  718.  
  719.    These commands permit the manipulation of mailbox or bulletin board
  720.    subscriptions.  Server support for subscription commands is optional.
  721.    Subscription status should be preserved between sessions.
  722.  
  723.  
  724.       tag SUBSCRIBE MAILBOX mailbox
  725.  
  726.          The SUBSCRIBE MAILBOX command adds the specified mailbox name
  727.  
  728.  
  729.  
  730. Crispin                                                        [Page 13]
  731.  
  732. Internet Draft                  IMAP2bis                 August 13, 1993
  733.  
  734.  
  735.          to the list of "active" or "subscribed" mailboxes as returned
  736.          by the FIND MAILBOXES command.  This command returns an OK
  737.          response only if the subscription is successful.
  738.  
  739.          If SUBSCRIBE MAILBOX is implemented then FIND MAILBOXES must
  740.          also be implemented, and FIND ALL.MAILBOXES should be
  741.          implemented.
  742.  
  743.  
  744.       tag UNSUBSCRIBE MAILBOX mailbox
  745.  
  746.          The UNSUBSCRIBE MAILBOX command removes the specified mailbox
  747.          name from the list of "active" or "subscribed" mailboxes as
  748.          returned by the FIND MAILBOXES command.  This command returns
  749.          an OK response only if the unsubscription is successful.
  750.  
  751.          If UNSUBSCRIBE MAILBOX is implemented then SUBSCRIBE MAILBOXES
  752.          and FIND MAILBOXES must also be implemented, and FIND
  753.          ALL.MAILBOXES should be implemented.
  754.  
  755.  
  756.       tag SUBSCRIBE BBOARD bboard
  757.  
  758.          The SUBSCRIBE BBOARD command adds the specified mailbox name to
  759.          the list of "active" or "subscribed" bulletin boards as
  760.          returned by the FIND BBOARDS command.  This command returns an
  761.          OK response only if the subscription is successful.
  762.  
  763.          If SUBSCRIBE BBOARD is implemented then FIND BBOARDS must also
  764.          be implemented, and FIND ALL.BBOARDS should be implemented.
  765.  
  766.  
  767.       tag UNSUBSCRIBE BBOARD bboard
  768.  
  769.          The UNSUBSCRIBE BBOARD command removes the specified mailbox
  770.          name from the list of "active" or "subscribed" bulletin boards
  771.          as returned by the FIND BBOARDS command.  This command returns
  772.          an OK response only if the unsubscription is successful.
  773.  
  774.          If UNSUBSCRIBE BBOARD is implemented then SUBSCRIBE BBOARDS and
  775.          FIND BBOARDS must also be implemented, and FIND ALL.BBOARDS
  776.          should be implemented.
  777.  
  778.  
  779.    tag SELECT mailbox
  780.  
  781.       This command select a particular mailbox.  The server must check
  782.       that the user is permitted read access to this mailbox.  Before
  783.  
  784.  
  785.  
  786. Crispin                                                        [Page 14]
  787.  
  788. Internet Draft                  IMAP2bis                 August 13, 1993
  789.  
  790.  
  791.       returning an OK to the client, the server must send the following
  792.       unsolicited data to the client:
  793.          FLAGS        mailbox's defined flags
  794.          <n> EXISTS   the number of messages in the mailbox
  795.          <n> RECENT   the number of new messages in the mailbox
  796.       in order to define the initial state of the mailbox at the client.
  797.  
  798.       Multiple selection commands are permitted in a session, in which
  799.       case the previous mailbox is automatically deselected when a new
  800.       selection is made.
  801.  
  802.       The mailbox name INBOX is a special name reserved to mean "the
  803.       primary mailbox for this user on this server".  The format of
  804.       other mailbox names is implementation dependent.
  805.  
  806.       The text of an OK response to the SELECT command should begin with
  807.       either "[READ-ONLY]" or "[READ-WRITE]" to show the mailbox's
  808.       access status.
  809.  
  810.  
  811.    tag EXAMINE mailbox
  812.  
  813.       The EXAMINE command is similar to SELECT, and returns the same
  814.       output; however, the selected mailbox is identified as read-only
  815.       and no changes are permitted to this mailbox.  EXAMINE has the
  816.       same mailbox namespace as SELECT.
  817.  
  818.       Server support for EXAMINE is optional.
  819.  
  820.  
  821.    tag BBOARD mailbox
  822.  
  823.       The BBOARD command is similar to SELECT, and returns the same
  824.       output.  Its argument is a shared mailbox (bulletin board) name
  825.       instead of an ordinary mailbox.  There is no requirement that the
  826.       namespace for BBOARD be the same as that for SELECT and EXAMINE.
  827.       BBOARD also differs from EXAMINE in that it may allow changes
  828.       (e.g. marking a message as seen or deleted) to a mailbox; the
  829.       exact handling of this is implementation dependent.
  830.  
  831.       Server support for BBOARD is optional.
  832.  
  833.  
  834.    tag CHECK
  835.  
  836.       The CHECK command requests a checkpoint of the mailbox.  CHECK may
  837.       cause an operation which may take a non-instantaneous amount of
  838.       real-time to complete.  The exact meaning of a checkpoint is
  839.  
  840.  
  841.  
  842. Crispin                                                        [Page 15]
  843.  
  844. Internet Draft                  IMAP2bis                 August 13, 1993
  845.  
  846.  
  847.       implementation-dependent.  Possible interpretations include
  848.       forcing a update of the server's disk of all changes made to the
  849.       selected mailbox, rescanning of the entire mailbox, etc.  If an
  850.       implementation has no such considerations, CHECK should be
  851.       equivalent to NOOP.
  852.  
  853.       CHECK should NOT be used to poll for new mail; new mail checking
  854.       happens implicitly as part of every command.  NOOP should be used
  855.       for any new mail polling.  CHECK should NOT be used to get the
  856.       current size of the mailbox; there is no guarantee that CHECK will
  857.       cause an EXISTS or RECENT unsolicited response.
  858.  
  859.  
  860.    tag EXPUNGE
  861.  
  862.       The EXPUNGE command permanently removes all messages with the
  863.       \DELETED flag set from the currently selected mailbox.  Before
  864.       returning an OK to the client, for each message that is removed,
  865.       an unsolicited EXPUNGE response is sent.  The message number for
  866.       each successive message in the mailbox is immediately decremented
  867.       by 1; this means that if the last 5 messages in a 9-message mail
  868.       file are expunged you will receive 5 unsolicited EXPUNGE responses
  869.       for message 5.
  870.  
  871.  
  872.    tag COPY sequence mailbox
  873.  
  874.       The COPY command copies the specified message(s) to the specified
  875.       destination mailbox.
  876.  
  877.       If the destination mailbox does not exist, a server that supports
  878.       the CREATE command SHOULD return an error.  It SHOULD NOT
  879.       automatically create the mailbox.  Unless it is certain that the
  880.       destination mailbox can not be created, the server MUST, prior to
  881.       the tagged NO response, send an unsolicited OK response with text
  882.       beginning with the string "[TRYCREATE]".  This gives a hint to the
  883.       client that it can attempt a CREATE command and retry the COPY if
  884.       the CREATE is successful.
  885.  
  886.       If the COPY command is unsuccessful for any reason, IMAP2bis
  887.       compliant server implementations MUST restore the destination
  888.       mailbox to its state prior to the COPY.
  889.  
  890.       EXAMPLE:  A003 COPY 2:4 MEETING
  891.       copies messages 2, 3, and 4 to mailbox "MEETING".
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Crispin                                                        [Page 16]
  899.  
  900. Internet Draft                  IMAP2bis                 August 13, 1993
  901.  
  902.  
  903.    tag APPEND mailbox string
  904.  
  905.       The APPEND command appends the string, which is in the format of
  906.       an RFC 822 message, to the specified mailbox.  If the append is
  907.       unsuccessful for any reason the mailbox must be restored to its
  908.       state prior to the append; no partial appending is permitted.  If
  909.       the mailbox is presently selected, the normal new mail actions
  910.       should occur.
  911.  
  912.       If the destination mailbox does not exist, a server MUST return an
  913.       error, and MUST NOT automatically create the mailbox.  Unless it
  914.       is certain that the destination mailbox can not be created, the
  915.       server MUST, prior to the tagged NO response, send an unsolicited
  916.       OK response with text beginning with the string "[TRYCREATE]".
  917.       This gives a hint to the client that it can attempt a CREATE
  918.       command and retry the APPEND if the CREATE is successful.
  919.  
  920.       Note that this functionality is unsuitable for message delivery,
  921.       because it does not provide a mechanism to transfer RFC 821 (SMTP)
  922.       envelope information.
  923.  
  924.       Server support for APPEND is optional.
  925.  
  926.  
  927.    tag FETCH sequence data
  928.  
  929.       The FETCH command retrieves data associated with a message in the
  930.       mailbox.  The data items to be fetched may be either a single atom
  931.       or an S-expression list.  The currently defined data items that
  932.       can be fetched are:
  933.  
  934.       ALL             Macro equivalent to:
  935.                       (FLAGS INTERNALDATE RFC822.SIZE ENVELOPE)
  936.  
  937.       BODY            The MIME body structure of the message.  The
  938.                       body is computed by the server by parsing the
  939.                       MIME header lines.
  940.  
  941.                       Server support for this data item is optional.
  942.  
  943.       BODY[section]   The text of a particular body section.  The
  944.                       section specification is a set of one or more
  945.                       part numbers delimited by periods.
  946.  
  947.                       Single-part messages only have a part 1.
  948.  
  949.                       Multipart messages are assigned consecutive
  950.                       part numbers, as they occur in the message.
  951.  
  952.  
  953.  
  954. Crispin                                                        [Page 17]
  955.  
  956. Internet Draft                  IMAP2bis                 August 13, 1993
  957.  
  958.  
  959.                       If a particular part is of type message or multipart,
  960.                       its parts must be indicated by a period followed by
  961.                       the part number within that nested multipart part.
  962.                       It is not permitted to fetch a multipart part
  963.                       itself, only its individual members.
  964.  
  965.                       A part of type MESSAGE also has nested parts,
  966.                       which are the parts of the MESSAGE part's body.
  967.  
  968.                       Every message has at least one part.
  969.  
  970.                       EXAMPLE: Here is a very complex message with its
  971.                       associated section specifications.
  972.                            1   TEXT/PLAIN
  973.                            2   APPLICATION/OCTET-STREAM
  974.                            3   MESSAGE/RFC822
  975.                            3.1   TEXT/PLAIN
  976.                            3.2   APPLICATION/OCTET-STREAM
  977.                                MULTIPART/MIXED
  978.                            4.1   IMAGE/GIF
  979.                            4.2   MESSAGE/RFC822
  980.                            4.2.1   TEXT/PLAIN
  981.                                    MULTIPART/ALTERNATIVE
  982.                            4.2.2.1  TEXT/PLAIN
  983.                            4.2.2.2  TEXT/RICHTEXT
  984.                       Note that there is no section specification for
  985.                       the Multi-part parts (no section 4 or 4.2.2).
  986.  
  987.                       The \SEEN flag is implicitly set; if this causes
  988.                       the flags to change they should be included as
  989.                       part of the fetch results.
  990.  
  991.                       Server support for this data item is optional.
  992.  
  993.       ENVELOPE        The envelope of the message.  The envelope is
  994.                       computed by the server by parsing the RFC 822
  995.                       header into the component parts, defaulting
  996.                       various fields as necessary.
  997.  
  998.       FAST            Macro equivalent to:
  999.                       (FLAGS INTERNALDATE RFC822.SIZE)
  1000.  
  1001.       FLAGS           The flags that are set for this message.
  1002.  
  1003.       FULL            Macro equivalent to:
  1004.                       (FLAGS INTERNALDATE RFC822.SIZE ENVELOPE BODY)
  1005.  
  1006.                       Server support for this data item is optional.
  1007.  
  1008.  
  1009.  
  1010. Crispin                                                        [Page 18]
  1011.  
  1012. Internet Draft                  IMAP2bis                 August 13, 1993
  1013.  
  1014.  
  1015.       INTERNALDATE    The date and time the message was written to
  1016.                       the mailbox.
  1017.  
  1018.       RFC822          The message in RFC 822 format.  The \SEEN
  1019.                       flag is implicitly set; if this causes the
  1020.                       flags to change they should be included as
  1021.                       part of the fetch results.  This is the
  1022.                       concatenation of RFC822.HEADER and RFC822.TEXT.
  1023.  
  1024.       RFC822.HEADER   The RFC 822 format header of the message as
  1025.                       stored on the server including the delimiting
  1026.                       blank line between the header and the body.
  1027.  
  1028.       RFC822.HEADER.LINES header_line_list
  1029.                       All header lines (including continuation lines)
  1030.                       of the RFC 822 format header of the message
  1031.                       with a field-name (as defined in RFC 822) that
  1032.                       matches any of the strings in header_line_list.
  1033.                       The matching is case-independent but otherwise
  1034.                       exact.
  1035.  
  1036.                       This is used to obtain a filtered header
  1037.                       containing only desired header lines.
  1038.  
  1039.                       Server support for this data item is optional.
  1040.  
  1041.       RFC822.HEADER.LINES.NOT header_line_list
  1042.                       All header lines (including continuation lines)
  1043.                       of the RFC 822 format header of the message
  1044.                       with a field-name (as defined in RFC 822) that
  1045.                       does not match any of the strings in
  1046.                       header_line_list.  The matching is
  1047.                       case-independent but otherwise exact.
  1048.  
  1049.                       This is used to obtain a filtered header not
  1050.                       containing undesired header lines.
  1051.  
  1052.                       Server support for this data item is optional.
  1053.  
  1054.       RFC822.SIZE     The number of characters in the message as
  1055.                       expressed in RFC 822 format.
  1056.  
  1057.       RFC822.TEXT     The text body of the message, omitting the
  1058.                       RFC 822 header.  The \SEEN flag is implicitly
  1059.                       set; if this causes the flags to change they
  1060.                       should be included as part of the fetch results.
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. Crispin                                                        [Page 19]
  1067.  
  1068. Internet Draft                  IMAP2bis                 August 13, 1993
  1069.  
  1070.  
  1071.       UID             The unique identifier for the message.
  1072.  
  1073.                       Server support for this data item is optional.
  1074.  
  1075.       EXAMPLES:
  1076.  
  1077.       A003 FETCH 2:4 ALL
  1078.          fetches the flags, internal date, RFC 822 size, and envelope
  1079.          for messages 2, 3, and 4.
  1080.  
  1081.       A004 FETCH 3 RFC822
  1082.          fetches the RFC 822 representation for message 3.
  1083.  
  1084.       A005 FETCH 4 (FLAGS RFC822.HEADER)
  1085.          fetches the flags and RFC 822 format header for message 4.
  1086.  
  1087.  
  1088.    tag PARTIAL msgno data start_byte byte_count
  1089.  
  1090.       The PARTIAL command is equivalent to the associated FETCH command,
  1091.       with the added functionality that only the specified number of
  1092.       bytes, beginning at the specified starting byte, are returned.
  1093.       Note that only a single message can be fetched at a time.  The
  1094.       first byte of a message, and hence the minimum for the starting
  1095.       byte, is byte 1.
  1096.  
  1097.       The following FETCH items are valid data for PARTIAL: RFC822,
  1098.       RFC822.HEADER, RFC822.TEXT, and BODY[section].
  1099.  
  1100.       Any partial fetch which attempts to read beyond the end of the
  1101.       text is truncated as appropriate.  If the starting byte is beyond
  1102.       the end of the text, an empty string is returned.
  1103.  
  1104.       The data is returned with the FETCH response.  There is no
  1105.       indication of the range of the partial data in this response; thus
  1106.       it is generally not possible to implement caching with PARTIAL
  1107.       data.  It is also not possible to stream multiple PARTIAL commands
  1108.       of the same data item without processing and synchronizing at each
  1109.       step, since each PARTIAL fetch of data replaces any prior
  1110.       (PARTIAL) FETCH of that data.
  1111.  
  1112.       Note that when partial fetching it is possible to break in the
  1113.       middle of a a line or a criticial sequence such as a BASE64
  1114.       quadruple or QUOTED-PRINTABLE shift.  Implementations using
  1115.       partial fetching should keep this in mind.  There is no
  1116.       requirement that partial fetches follow any sequence; so if it
  1117.       turns out that a partial fetch of bytes 1 through 10000 breaks in
  1118.       an awkward place, it is permitted to continue with a partial fetch
  1119.  
  1120.  
  1121.  
  1122. Crispin                                                        [Page 20]
  1123.  
  1124. Internet Draft                  IMAP2bis                 August 13, 1993
  1125.  
  1126.  
  1127.       of 9987 through 19987, etc.
  1128.  
  1129.       The handling of the \SEEN flag is the same as with the FETCH
  1130.       command.
  1131.  
  1132.       Server support for PARTIAL is optional.
  1133.  
  1134.  
  1135.    tag STORE sequence data value
  1136.  
  1137.       The STORE command alters data associated with a message in the
  1138.       mailbox.  The currently defined data items that can be stored are:
  1139.  
  1140.          FLAGS           Replace the flags for the message with the
  1141.                          argument (in flag list format).
  1142.  
  1143.          +FLAGS          Add the flags in the argument to the
  1144.                          message's flag list.
  1145.  
  1146.          -FLAGS          Remove the flags in the argument from the
  1147.                          message's flag list.
  1148.  
  1149.       EXAMPLE:  A003 STORE 2:4 +FLAGS (\DELETED)
  1150.       marks messages 2, 3, and 4 for deletion.
  1151.  
  1152.  
  1153.    UID commands
  1154.  
  1155.    These commands use unique identifiers instead of message numbers in
  1156.    their arguments to reference a particular message or range of
  1157.    messages.
  1158.  
  1159.    Sequence ranges are permitted; note however that there is no
  1160.    guarantee that unique identifiers be contiguous.  A non-existant
  1161.    unique identifier within a sequence range is ignored without any
  1162.    error message generated.
  1163.  
  1164.    Because of the potential for ambiguity, the UID command does not
  1165.    change responses.  That is, the number after the "*" in an
  1166.    unsolicited FETCH response is a message number, not a unique
  1167.    identifier.  However, servers MUST implicitly include UID as part of
  1168.    any FETCH response caused by a UID command, regardless of whether or
  1169.    not UID was specified.
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Crispin                                                        [Page 21]
  1179.  
  1180. Internet Draft                  IMAP2bis                 August 13, 1993
  1181.  
  1182.  
  1183.    EXAMPLE:  C: A003 UID FETCH 4827313:4828442 FLAGS
  1184.              S: * 23 FETCH (FLAGS (\SEEN) UID 4827313)
  1185.              S: * 24 FETCH (FLAGS (\SEEN) UID 4827943)
  1186.              S: * 25 FETCH (FLAGS (\SEEN) UID 4828442)
  1187.              S: A003 UID FETCH completed
  1188.  
  1189.  
  1190.       tag UID AFTER uniqueid
  1191.  
  1192.          The UID AFTER command is used to determine what unique
  1193.          identifiers exist that are greater than the specified unique
  1194.          identifier.  It returns unsolicited FETCH responses for each
  1195.          such message.
  1196.  
  1197.          For example, if the specified unique identifier refers to
  1198.          message 572 in a mailbox with 613 messages, the results
  1199.          returned are equivalent to doing "FETCH 573:613 UID".
  1200.  
  1201.  
  1202.       tag UID BEFORE uniqueid
  1203.  
  1204.          The UID BEFORE command is used to determine what unique
  1205.          identifiers exist that are less than the specified unique
  1206.          identifier.  It returns unsolicited FETCH responses for each
  1207.          such message.
  1208.  
  1209.          For example, if the specified unique identifier refers to
  1210.          message 572 in a mailbox with 613 messages, the results
  1211.          returned are equivalent to doing "FETCH 1:571 UID".
  1212.  
  1213.  
  1214.       tag UID COPY sequence mailbox
  1215.  
  1216.          The UID COPY command is identical to the COPY command, with the
  1217.          exception that the numbers used in the sequence are unique
  1218.          identifiers instead of message numbers.
  1219.  
  1220.  
  1221.       tag UID FETCH sequence data
  1222.  
  1223.          The UID FETCH command is identical to the FETCH command, with
  1224.          the exception that the numbers used in the sequence are unique
  1225.          identifiers instead of message numbers.
  1226.  
  1227.  
  1228.       tag UID STORE sequence data value
  1229.  
  1230.          The UID STORE command is identical to the STORE command, with
  1231.  
  1232.  
  1233.  
  1234. Crispin                                                        [Page 22]
  1235.  
  1236. Internet Draft                  IMAP2bis                 August 13, 1993
  1237.  
  1238.  
  1239.          the exception that the numbers used in the sequence are unique
  1240.          identifiers instead of message numbers.
  1241.  
  1242.  
  1243.    tag SEARCH search_criteria
  1244.  
  1245.       The SEARCH command searches the mailbox for messages that match
  1246.       the given set of criteria.  The unsolicited SEARCH <1#number>
  1247.       response from the server is a list of messages that express the
  1248.       intersection (AND function) of all the messages which match that
  1249.       criteria.  For example,
  1250.               A003 SEARCH DELETED FROM "SMITH" SINCE 1-OCT-87
  1251.       returns the message numbers for all deleted messages from Smith
  1252.       that were placed in the mail file since October 1, 1987.
  1253.  
  1254.       In all search criteria which use strings, a message matches the
  1255.       criteria if the string is a substring of that field.  The matching
  1256.       is case-independent except as noted below.
  1257.  
  1258.       The string may be in RFC 1342 format to express a character set
  1259.       other than US-ASCII.  In this case, the criteria matches if the
  1260.       string matches the character set and characters of a substring of
  1261.       that field.  A server implementation may omit case-independent
  1262.       matching on RFC 1342 strings.
  1263.  
  1264.       The currently defined search criteria are:
  1265.  
  1266.       ALL             All messages in the mailbox; the default
  1267.                       initial criterion for ANDing.
  1268.  
  1269.       ANSWERED        Messages with the \ANSWERED flag set.
  1270.  
  1271.       BCC istring     Messages which contain the specified string
  1272.                       in the envelope's BCC field.
  1273.  
  1274.       BEFORE date     Messages whose internal date is earlier than
  1275.                       the specified date.
  1276.  
  1277.       BODY istring    Messages which contain the specified string
  1278.                       in the body of the message.
  1279.  
  1280.       CC istring      Messages which contain the specified string
  1281.                       in the envelope's CC field.
  1282.  
  1283.       DELETED         Messages with the \DELETED flag set.
  1284.  
  1285.       FLAGGED         Messages with the \FLAGGED flag set.
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Crispin                                                        [Page 23]
  1291.  
  1292. Internet Draft                  IMAP2bis                 August 13, 1993
  1293.  
  1294.  
  1295.       FROM istring    Messages which contain the specified string
  1296.                       in the envelope's FROM field.
  1297.  
  1298.       KEYWORD flag    Messages with the specified flag set.
  1299.  
  1300.       NEW             Messages which have the \RECENT flag set but
  1301.                       not the \SEEN flag.  This is functionally
  1302.                       equivalent to "RECENT UNSEEN".
  1303.  
  1304.       OLD             Messages which do not have the \RECENT flag
  1305.                       set.
  1306.  
  1307.       ON date         Messages whose internal date is within the
  1308.                       specified date.
  1309.  
  1310.       RECENT          Messages which have the \RECENT flag set.
  1311.  
  1312.       SEEN            Messages which have the \SEEN flag set.
  1313.  
  1314.       SINCE date      Messages whose internal date is later than
  1315.                       the specified date.
  1316.  
  1317.       SUBJECT istring Messages which contain the specified string
  1318.                       in the envelope's SUBJECT field.
  1319.  
  1320.       TEXT istring    Messages which contain the specified string.
  1321.  
  1322.       TO istring      Messages which contain the specified string in
  1323.                       the envelope's TO field.
  1324.  
  1325.       UNANSWERED      Messages which do not have the \ANSWERED flag
  1326.                       set.
  1327.  
  1328.       UNDELETED       Messages which do not have the \DELETED flag
  1329.                       set.
  1330.  
  1331.       UNFLAGGED       Messages which do not have the \FLAGGED flag
  1332.                       set.
  1333.  
  1334.       UNKEYWORD flag  Messages which do not have the specified flag
  1335.                       set.
  1336.  
  1337.       UNSEEN          Messages which do not have the \SEEN flag set.
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346. Crispin                                                        [Page 24]
  1347.  
  1348. Internet Draft                  IMAP2bis                 August 13, 1993
  1349.  
  1350.  
  1351. Responses
  1352.  
  1353.    The first group of responses complete a request, and indicate whether
  1354.    or not the command was successful.  The response text is a line of
  1355.    human readable text, optionally prefixed by an atom inside square
  1356.    brackets that conveys a special information token between cooperating
  1357.    servers and clients.
  1358.  
  1359.    The currently defined special information tokens are:
  1360.  
  1361.       PARSE           An error occurred in parsing the RFC 822 or MIME
  1362.                       headers of a message in the mailbox.
  1363.  
  1364.       READ-ONLY       The mailbox is open read-only, or its access while
  1365.                       open has changed from read-write to read-only.
  1366.  
  1367.       READ-WRITE      The mailbox is open read-write, or its access while
  1368.                       open has changed from read-only to read-write.
  1369.  
  1370.       TRYCREATE       An APPEND or COPY attempt failed because the target
  1371.                       mailbox does not exist.  The server sends this as a
  1372.                       hint to the client that the operation would probably
  1373.                       succeed if the mailbox is first created by means of
  1374.                       the CREATE command.
  1375.  
  1376.       hex string      A hexadecimal string is returned as a special
  1377.                       information token to represent a Kerberos return
  1378.                       authenticator.  This only occurs in response to a
  1379.                       LOGIN command that uses Kerberos authentication.
  1380.  
  1381.    Other special information tokens defined by particular client or
  1382.    server implementations should be prefixed with an "X" until such time
  1383.    as they are added to a revision of this protocol.
  1384.  
  1385.  
  1386.    tag OK response_text
  1387.  
  1388.       This response identifies successful completion of the command with
  1389.       that tag.  The response text may be useful in a protocol telemetry
  1390.       log for debugging purposes.
  1391.  
  1392.  
  1393.    tag NO response_text
  1394.  
  1395.       This response identifies unsuccessful completion of the command
  1396.       with that tag.  The text is a line of human-readable text that
  1397.       probably should be displayed to the user in an error report by the
  1398.       client.
  1399.  
  1400.  
  1401.  
  1402. Crispin                                                        [Page 25]
  1403.  
  1404. Internet Draft                  IMAP2bis                 August 13, 1993
  1405.  
  1406.  
  1407.    tag BAD response_text
  1408.  
  1409.       This response identifies faulty protocol received from the client;
  1410.       The text is a line of human-readable text that should be recorded
  1411.       in any telemetry as part of a bug report to the maintainer of the
  1412.       client.
  1413.  
  1414.  
  1415.    The second group of responses convey human-readable information.  The
  1416.    response text is a line of human readable text, optionally prefixed
  1417.    by an atom inside square brackets that conveys special information
  1418.    between cooperating servers and clients.
  1419.  
  1420.  
  1421.    * PREAUTH response_text
  1422.  
  1423.       This response is one of three possible greetings at session
  1424.       startup.  It indicates that the session has already been
  1425.       authenticated by external means and thus no LOGIN command is
  1426.       needed.
  1427.  
  1428.  
  1429.    * OK response_text
  1430.  
  1431.       This response identifies an information message from the server.
  1432.       It does not indicate completion of any particular request, nor is
  1433.       it necessarily related to any request.  The text is a line of
  1434.       human-readable text that should be presented to the user as an
  1435.       information message.
  1436.  
  1437.       This response is also one of three possible greetings at session
  1438.       startup.  It indicates that the session is not yet authenticated
  1439.       and that a LOGIN command is needed.
  1440.  
  1441.  
  1442.    * NO response_text
  1443.  
  1444.       This response identifies a warning message from the server.  It
  1445.       does not indicate completion of any request, nor is it necessarily
  1446.       related to any request.  The text is a line of human-readable text
  1447.       that should be presented to the user as a warning of improper
  1448.       operation.
  1449.  
  1450.  
  1451.    * BAD response_text
  1452.  
  1453.       This response identifies a serious error message from the server.
  1454.       It does not indicate completion of any request, nor is it
  1455.  
  1456.  
  1457.  
  1458. Crispin                                                        [Page 26]
  1459.  
  1460. Internet Draft                  IMAP2bis                 August 13, 1993
  1461.  
  1462.  
  1463.       necessarily related to any request.  It may also indicate a faulty
  1464.       command from the client in which a tag could not be parsed.  The
  1465.       text is a line of human-readable text that should be presented to
  1466.       the user as a serious or possibly fatal error.
  1467.  
  1468.  
  1469.    * BYE text
  1470.  
  1471.       This response identifies that the server is about to close the
  1472.       connection.  The text is a line of human-readable text that should
  1473.       be displayed to the user in a status report by the client.  This
  1474.       may be sent as part of a normal logout sequence, or as a panic
  1475.       shutdown announcement by the server.  It is also used by some
  1476.       servers as an announcement of an inactivity autologout.
  1477.  
  1478.       This response is also one of three possible greetings at session
  1479.       startup.  It indicates that the server is not willing to accept a
  1480.       session from this client at the present time.
  1481.  
  1482.  
  1483.    The third group of responses convey data about the mailbox or
  1484.    messages inside the mailbox.  This is how message data is transmitted
  1485.    from the server to the client.
  1486.  
  1487.  
  1488.    * MAILBOX mstring
  1489.  
  1490.       This response occurs as a result of a FIND command for MAILBOXES
  1491.       and ALL.MAILBOXES.  The string is a mailbox name that matches the
  1492.       pattern in the command.
  1493.  
  1494.  
  1495.    * BBOARD mstring
  1496.  
  1497.       This response occurs as a result of a FIND command for BBOARDS and
  1498.       ALL.BBOARDS.  The string is a bulletin board name that matches the
  1499.       pattern in the command.
  1500.  
  1501.  
  1502.    * SEARCH number(s)
  1503.  
  1504.       This response occurs as a result of a SEARCH command.  The
  1505.       number(s) refer to those messages that match the search criteria.
  1506.       Each number is delimited by a space, e.g., "SEARCH 2 3 6".
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Crispin                                                        [Page 27]
  1515.  
  1516. Internet Draft                  IMAP2bis                 August 13, 1993
  1517.  
  1518.  
  1519.    * FLAGS flag_list
  1520.  
  1521.       This response occurs as a result of a selection command (SELECT,
  1522.       BBOARD, and EXAMINE).  The flag list are the list of flags (at a
  1523.       minimum, the system-defined flags) that are applicable for this
  1524.       mailbox.  Flags other than the system flags are a function of the
  1525.       server implementation.
  1526.  
  1527.  
  1528.    * number message_data
  1529.  
  1530.       This response occurs as a result of any command when a mailbox is
  1531.       selected. The message_data is one of the following:
  1532.  
  1533.  
  1534.       EXISTS  The specified number of messages exists in the mailbox.
  1535.  
  1536.  
  1537.       RECENT  The specified number of messages have arrived since the
  1538.               previous time this mailbox was read.
  1539.  
  1540.  
  1541.       EXPUNGE The specified message number has been permanently
  1542.               removed from the mailbox, and the next message in the
  1543.               mailbox (if any) becomes that message number.
  1544.  
  1545.               An unsolicited EXPUNGE response MUST NOT be sent except
  1546.               while responding to a request other than FETCH, STORE,
  1547.               or SEARCH.  All references to message numbers sent after
  1548.               an unsolicited EXPUNGE response are adjusted to reflect
  1549.               the effect of the expunge.
  1550.  
  1551.                  Discussion: a potential ambiguity exists with
  1552.                  the FETCH, STORE, and SEARCH requests if the
  1553.                  server is permitted to send unsolicited EXPUNGE
  1554.                  responses.  This is because these requests can be
  1555.                  streamed.  If two successive FETCH requests are
  1556.                  streamed, and if during the time of the processing
  1557.                  of the first request there is an expunge response,
  1558.                  then the sequence of the second request is no
  1559.                  longer valid.
  1560.  
  1561.  
  1562.       FETCH data
  1563.               This is the principle means by which data about a
  1564.               message is returned to the client.  The data is in a
  1565.               S-expression form, and consists of a sequence of pairs
  1566.               of data item name and their values.  The current data
  1567.  
  1568.  
  1569.  
  1570. Crispin                                                        [Page 28]
  1571.  
  1572. Internet Draft                  IMAP2bis                 August 13, 1993
  1573.  
  1574.  
  1575.               items are:
  1576.  
  1577.          BODY          An S-expression format list that describes the
  1578.                        body of a message.  The body is computed by the
  1579.                        server by parsing the RFC 822 header and body into
  1580.                        the component parts, defaulting various fields
  1581.                        as necessary.
  1582.  
  1583.                        Multiple parts are indicated by S-expression
  1584.                        nesting.  In this case, instead of a body type
  1585.                        as the first element of the list there is a nested
  1586.                        body.  The last element of the list is the multipart
  1587.                        subtype (mixed, digest, parallel, alternative, etc.).
  1588.  
  1589.                        The basic fields of a non-multipart body part are in
  1590.                        the following order:
  1591.                          body type - an atom giving the content type name
  1592.                            as defined in MIME
  1593.                          body subtype - a string giving the content subtype
  1594.                            name as defined in MIME
  1595.                          body parameter list - an S-expression list of
  1596.                            attribute/value pairs [e.g. (foo bar baz rag)
  1597.                            where "bar" is the value of "foo" and "rag" is
  1598.                            the value of "baz"] as defined in MIME.
  1599.                          body id - a string giving the content id as
  1600.                            defined in MIME.
  1601.                          body description - a string giving the content
  1602.                            description as defined in MIME.
  1603.                          body encoding - a string giving the content
  1604.                            transfer encoding as defined in MIME.
  1605.                          body size - a number giving the size of that
  1606.                            body in bytes.  Note that this size is the
  1607.                            size in its transfer encoding and not the
  1608.                            resulting size.
  1609.  
  1610.                        A body type of type MESSAGE and subtype RFC822
  1611.                        contains, immediately after the basic fields,
  1612.                        the envelope of the encapsulated message, its
  1613.                        body structure, and its size in text lines.
  1614.  
  1615.                        A body type of type TEXT contains, immediately
  1616.                        after the basic fields, the size of the body
  1617.                        in text lines.
  1618.  
  1619.          BODY[section] A string expressing the body contents of the
  1620.                        specified section.  This string is transmitted
  1621.                        as 7-bit US-ASCII, and interpreted according to
  1622.                        the content transfer encoding and the body type
  1623.  
  1624.  
  1625.  
  1626. Crispin                                                        [Page 29]
  1627.  
  1628. Internet Draft                  IMAP2bis                 August 13, 1993
  1629.  
  1630.  
  1631.                        and subtype.
  1632.  
  1633.                        Note that 7-bit US-ASCII is the transport format
  1634.                        and NOT necessarily the byte size or character
  1635.                        set of the result.  The resulting data may be
  1636.                        8-bit; it may also be some other character set
  1637.                        or binary.
  1638.  
  1639.          ENVELOPE      An S-expression format list that describes the
  1640.                        envelope of a message.  The envelope is computed
  1641.                        by the server by parsing the RFC 822 header into
  1642.                        the component parts, defaulting various fields
  1643.                        as necessary.
  1644.  
  1645.                        The fields of the envelope are in the following
  1646.                        order: date, subject, from, sender, reply-to, to,
  1647.                        cc, bcc, in-reply-to, and message-id.  The date,
  1648.                        subject, in-reply-to, and message-id fields are
  1649.                        strings.  The from, sender, reply-to, to, cc,
  1650.                        and bcc fields are lists of addresses.
  1651.  
  1652.                        An address is an S-expression format list that
  1653.                        describes an electronic mail address.  The fields
  1654.                        of an address are in the following order:
  1655.                        personal name, source-route (a.k.a. the
  1656.                        at-domain-list in SMTP), mailbox name, and
  1657.                        host name.
  1658.  
  1659.                        Any field of an envelope or address that is
  1660.                        not applicable is presented as the atom NIL.
  1661.                        Note that the server must default the reply-to
  1662.                        and sender fields from the from field; a client is
  1663.                        not expected to know to do this.
  1664.  
  1665.          FLAGS         An S-expression format list of flags that are set
  1666.                        for this message.  This may include the following
  1667.                        system flags:
  1668.  
  1669.                        \RECENT       Message arrived since the
  1670.                                       previous time this mailbox
  1671.                                       was read
  1672.                        \SEEN         Message has been read
  1673.                        \ANSWERED     Message has been answered
  1674.                        \FLAGGED      Message is "flagged" for
  1675.                                       urgent/special attention
  1676.                        \DELETED      Message is "deleted" for
  1677.                                       removal by later EXPUNGE
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Crispin                                                        [Page 30]
  1683.  
  1684. Internet Draft                  IMAP2bis                 August 13, 1993
  1685.  
  1686.  
  1687.          INTERNALDATE  A string containing the date and time the
  1688.                        message was written to the mailbox.
  1689.  
  1690.          RFC822        A string expressing the message in RFC 822
  1691.                        format.
  1692.  
  1693.          RFC822.HEADER A string expressing the RFC 822 format header
  1694.                        of the message, including the delimiting
  1695.                        blank line between the header and the body.
  1696.                        This is used for the FETCH data items
  1697.                        RFC822.HEADER, RFC822.HEADER.LINES, and
  1698.                        RFC822.HEADER.LINES.NOT (note that a blank
  1699.                        line is always included regardless of header
  1700.                        line restrictions).
  1701.  
  1702.          RFC822.SIZE   A number indicating the number of
  1703.                        characters in the message as expressed
  1704.                        in RFC 822 format.
  1705.  
  1706.          RFC822.TEXT   A string expressing the text body of the
  1707.                        message, omitting the RFC 822 header.
  1708.  
  1709.          UID           A string expressing the unique identifier
  1710.                        of the message.
  1711.  
  1712.  
  1713.       COPY    Obsolete.  New server implementations MUST NOT transmit
  1714.               this response.  Client implementations SHOULD ignore
  1715.               this response (not report an error).
  1716.  
  1717.  
  1718.       STORE data
  1719.               Obsolete and functionally equivalent to FETCH.  New
  1720.               server implementations MUST NOT transmit this response.
  1721.               Client implementations SHOULD treat this response as
  1722.               equivalent to the FETCH response.
  1723.  
  1724.  
  1725.    The final group of responses contains a single, special purpose
  1726.    response.
  1727.  
  1728.    + text
  1729.  
  1730.       This response identifies that the server is ready to accept the
  1731.       text of a literal from the client.  The text of this response is a
  1732.       line of human-readable text of the server's choosing (it is
  1733.       generally never seen by a client's human user).
  1734.  
  1735.  
  1736.  
  1737.  
  1738. Crispin                                                        [Page 31]
  1739.  
  1740. Internet Draft                  IMAP2bis                 August 13, 1993
  1741.  
  1742.  
  1743.       The purpose of this command is to solve a synchronization problem
  1744.       which can occur if one of the strings in a command is a literal.
  1745.       This may occur when logging in (if the password contains "funny"
  1746.       characters) and especially with the APPEND command (since the
  1747.       message sent consists of multiple lines).
  1748.  
  1749.       Normally, a command from the client is a single text line.  If the
  1750.       server detects an error in the command, it can simply discard the
  1751.       remainder of the line.  It cannot do this for commands that
  1752.       contain literals, since a literal can be an arbitrarily long
  1753.       amount of text, and the server may not even be expecting a
  1754.       literal.  This mechanism is provided so the client knows not to
  1755.       send a literal until the server expects it, preserving
  1756.       client/server synchronization.
  1757.  
  1758.       No such synchronization protection is provided for literals sent
  1759.       from the server to the client.  Nor is any necessary.  Any
  1760.       synchronization problems in this direction would be caused by a
  1761.       bug in the client or server.
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Crispin                                                        [Page 32]
  1795.  
  1796. Internet Draft                  IMAP2bis                 August 13, 1993
  1797.  
  1798.  
  1799. Sample IMAP2bis session
  1800.  
  1801.    The following is a transcript of an IMAP2bis session.  One very long
  1802.    long line in this sample is broken for editorial clarity.
  1803.  
  1804.    S:   * OK IMAP2bis Service 7.2(62) at Thu, 29 Jul 1993 21:34:23 -0700 (PDT)
  1805.    C:   a001 login mrc secret
  1806.    S:   a001 OK LOGIN completed
  1807.    C:   a002 select inbox
  1808.    S:   * 18 EXISTS
  1809.    S:   * FLAGS (\Answered \Flagged \Deleted \Seen)
  1810.    S:   * 0 RECENT
  1811.    S:   a002 OK [READ-WRITE] SELECT completed
  1812.    S:   a003 fetch 12 full
  1813.    S:   * 12 FETCH (FLAGS (\Seen) INTERNALDATE "14-Jul-1993 02:44:25 -0700"
  1814.          RFC822.SIZE 4282 ENVELOPE ("Wed, 14 Jul 1993 02:23:25 -0700 (PDT)"
  1815.          "IMAP2bis WG mtg summary and minutes" (("Terry Gray" NIL "gray"
  1816.          "cac.washington.edu")) ((NIL NIL "owner-imap" "cac.washington.edu"))
  1817.          (("Terry Gray" NIL "gray" "cac.washington.edu")) ((NIL NIL "imap"
  1818.          "cac.washington.edu")) ((NIL NIL "minutes" "CNRI.Reston.VA.US")
  1819.          ("John C Klensin" NIL "KLENSIN" "INFOODS.MIT.EDU")("Erik Huizer"
  1820.          NIL "Erik.Huizer" "SURFnet.nl")) NIL NIL
  1821.          "<Pine.3.84.9307140123.B27397-0100000@shiva2.cac.washington.edu>")
  1822.           BODY ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 3028 92))
  1823.    S:    a003 OK FETCH completed
  1824.    C:    a004 fetch 12 rfc822.header
  1825.    S:    * 12 FETCH (RFC822.HEADER {485}
  1826.    S:    Date: Wed, 14 Jul 1993 02:23:25 -0700 (PDT)
  1827.    S:    From: Terry Gray <gray@cac.washington.edu>
  1828.    S:    Reply-To: Terry Gray <gray@cac.washington.edu>
  1829.    S:    Subject: IMAP2bis WG mtg summary and minutes
  1830.    S:    To: imap@cac.washington.edu
  1831.    S:    Cc: minutes@CNRI.Reston.VA.US,
  1832.    S:            John C Klensin <KLENSIN@INFOODS.MIT.EDU>,
  1833.    S:            Erik Huizer <Erik.Huizer@SURFnet.nl>
  1834.    S:    Message-Id:
  1835.    S:     <Pine.3.84.9307140123.B27397-0100000@shiva2.cac.washington.edu>
  1836.    S:    Mime-Version: 1.0
  1837.    S:    Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  1838.    S:
  1839.    S:    )
  1840.    S:    a004 OK FETCH completed
  1841.    C:    a005 store 12 +flags \deleted
  1842.    S:    * 12 FETCH (FLAGS (\Seen \Deleted))
  1843.    S:    a005 OK +FLAGS completed
  1844.    C:    a006 logout
  1845.    S:    * BYE IMAP2bis server terminating connection
  1846.    S:    a006 OK LOGOUT completed
  1847.  
  1848.  
  1849.  
  1850. Crispin                                                        [Page 33]
  1851.  
  1852. Internet Draft                  IMAP2bis                 August 13, 1993
  1853.  
  1854.  
  1855. Design Discussion
  1856.  
  1857.    IMAP2bis is a textual protocol.  The use of MIME encoding in IMAP2bis
  1858.    makes it possible to support 8-bit textual and binary mail.
  1859.  
  1860.    IMAP2bis implementations MAY transmit 8-bit characters in literals,
  1861.    but should do so only when the character set is identified.  For
  1862.    example, 8-bit characters are specifically permitted in MIME body
  1863.    parts (fetching BODY[section]) of type TEXT.  8-bit characters are
  1864.    also permitted in the argument to APPEND.
  1865.  
  1866.    For compatibility with the 7-bit world, servers MUST NOT transmit 8-
  1867.    bit characters in RFC822.HEADER fetch results, and SHOULD NOT
  1868.    transmit 8-bit characters in RFC822.TEXT (and by extension RFC822)
  1869.    fetch results.
  1870.  
  1871.    Because 8-bit characters are permitted in the argument to APPEND, a
  1872.    server in the 7-bit world MUST, if it implements the APPEND command,
  1873.    be able to make a reversible conversion of the 8-bit APPEND data to
  1874.    7-bit data using MIME.
  1875.  
  1876.    Although a BINARY body encoding is defined, IMAP2bis does not permit
  1877.    unencoded binary strings.  A "binary string" is any string with NUL
  1878.    characters; a string with an excessive number of CTL characters may
  1879.    also be considered to be binary.  The mixing of unencoded binary in
  1880.    the same stream as textual commands would make the protocol more
  1881.    vulnerable to synchronization problems.  Implementations MUST encode
  1882.    binary data into BASE64 prior to transmitting it with IMAP2bis.
  1883.  
  1884.    When operating in the online model, an IMAP2bis client should
  1885.    maintain a local cache of data from the mailbox.  This cache is an
  1886.    incomplete model of the mailbox, and at startup is generally empty.
  1887.    As the client processes all unsolicited data, it updates the cache
  1888.    based on this data.  When a tagged response arrives, the client's
  1889.    cache has been updated from the associated request.
  1890.  
  1891.    Note that a server can send data that the client did not request,
  1892.    such as mailbox size or flag updates.  A server MUST send mailbox
  1893.    size updates automatically in the course of processing a command.  A
  1894.    server SHOULD send message flag updates automatically, without
  1895.    requiring the client to request such updates explicitly.
  1896.  
  1897.    Regardless of what implementation decisions a client may take on
  1898.    caching, a client MUST record EXISTS and RECENT updates and MUST NOT
  1899.    assume that a CHECK or NOOP command will return EXISTS or RECENT
  1900.    information.
  1901.  
  1902.    Although it is permitted for a server to send an unsolicited response
  1903.  
  1904.  
  1905.  
  1906. Crispin                                                        [Page 34]
  1907.  
  1908. Internet Draft                  IMAP2bis                 August 13, 1993
  1909.  
  1910.  
  1911.    while there is no command in progress, this practice SHOULD NOT be
  1912.    followed due to flow control considerations.  It can cause an
  1913.    incautious implementation to deadlock.  A deadlock is avoided if
  1914.    either of the following conditions are true: (1) with the exception
  1915.    of the greeting, the server never sends responses while there is no
  1916.    command in progress; (2) the client always reads responses from the
  1917.    IMAP2bis connection regardless of whether or not a command is in
  1918.    progress (or even if it is transmitting the command).  The latter
  1919.    condition generally requires a multi-threading client implementation,
  1920.    which may not always be feasible.
  1921.  
  1922.    If a server has an inactivity autologout timer, that timer MUST be of
  1923.    at least 30 minutes' duration.  The receipt of a NOOP command from
  1924.    the client during that interval should suffice to reset the
  1925.    autologout timer.  Periodic transmission of a NOOP from the client
  1926.    during periods of inactivity also has the benefit of avoiding the
  1927.    possible deadlock noted above, or even act as a poll for updates.
  1928.  
  1929.    It is frequently asked why there is no message posting capabilities
  1930.    in IMAP2bis.  Message posting is orthogonal to the scope of a mail
  1931.    access protocol and detracts from its primary focus.  SMTP (RFC 821)
  1932.    provides the minimal functionality needed for message posting without
  1933.    losing valuable capabilities (such as blind carbon copies).  Any
  1934.    message posting capability in IMAP2bis would need, at a minimum, to
  1935.    provide equivalent capabilities.
  1936.  
  1937.    At the time of the writing of this document, an extensive set of
  1938.    extensions to SMTP is in the Internet standards process.  Should
  1939.    those extensions become an Internet Standard it would be necessary to
  1940.    revise IMAP2bis again to provide corresponding capabilities, if a
  1941.    message posting facility was included in IMAP2bis.  In other words, a
  1942.    duplication of effort would be required each time a change is made to
  1943.    message transport technology.
  1944.  
  1945.    Another undesirable aspect of message posting in IMAP2bis occurs when
  1946.    a (very) remote server is used.  It is unlikely that a client will
  1947.    support multiple means of posting a message; it adds excessive size
  1948.    and complexity which can not be afforded, particularly on smaller
  1949.    machines.  Consider a client connecting to an IMAP2bis server over an
  1950.    interactive satellite link to a foreign country.  A local message
  1951.    posting (SMTP) server is available which uses a lower-cost batched
  1952.    link.  In this case, the use of the interactive link would be
  1953.    wasteful and costly.
  1954.  
  1955.    Message posting to IMAP2bis has been suggested as a means of
  1956.    authenticating postings.  The problem is that access authentication
  1957.    credentials are not necessarily the same as posting authentication
  1958.    credentials.  At some sites, the disclosure of a portion of access
  1959.  
  1960.  
  1961.  
  1962. Crispin                                                        [Page 35]
  1963.  
  1964. Internet Draft                  IMAP2bis                 August 13, 1993
  1965.  
  1966.  
  1967.    authentication credentials in a mail message (as a "From" or "Sender"
  1968.    address) may be a serious security breach of greater significance
  1969.    than forged mail.
  1970.  
  1971.    The Internet message transport infrastructure has no concept of
  1972.    authentication credentials, and neither authentication syntax nor
  1973.    semantics are transferred within a message.  As a result, any attempt
  1974.    at authenticating a message via posting authenticaton is completely
  1975.    ineffective once the message leaves the authenticating server; any
  1976.    indication of authentication in the message can easily be reproduced
  1977.    further down the line.  It is for this reason that public-key based
  1978.    message authentication systems such as Privacy Enhanced Mail are
  1979.    presently under development.
  1980.  
  1981.    IMAP2bis does not address problems with multiple IMAP2bis servers at
  1982.    a single site, access control lists, and mobility of client
  1983.    configuration and address book information.  These and other issues
  1984.    are being considered for a companion protocol (Interactive Mail
  1985.    Support Protocol) being developed at CMU.
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018. Crispin                                                        [Page 36]
  2019.  
  2020. Internet Draft                  IMAP2bis                 August 13, 1993
  2021.  
  2022.  
  2023. Formal Syntax
  2024.  
  2025.    The following syntax specification uses the augmented Backus-Naur
  2026.    Form (BNF) notation as specified in RFC 822 with one exception; the
  2027.    delimiter used with the "#" construct is a single space (SPACE) and
  2028.    not a comma.
  2029.  
  2030.    Except as noted otherwise, all alphabetic characters in the IMAP2bis
  2031.    protocol are case-insensitive.  For example, "LOGIN", "login" and
  2032.    "lOgIn" are all valid as the login command.
  2033.  
  2034.    Syntax marked as obsolete may be encountered with implementations
  2035.    written for an older version of this specification.  New
  2036.    implementations SHOULD accept obsolete syntax as input, but MUST NOT
  2037.    otherwise use it.
  2038.  
  2039.    address         ::= "(" addr_name SPACE addr_adl SPACE addr_mailbox
  2040.                        SPACE addr_host ")"
  2041.  
  2042.    addr_adl        ::= nil / string
  2043.  
  2044.    addr_host       ::= nil / string
  2045.  
  2046.    addr_mailbox    ::= nil / string
  2047.  
  2048.    addr_name       ::= nil / string
  2049.  
  2050.    append          ::= "APPEND" SPACE mailbox SPACE string
  2051.  
  2052.    astring         ::= atom / string
  2053.  
  2054.    atom            ::= 1*<any CHAR except specials, SPACE, and CTLs>
  2055.  
  2056.    bboard          ::= "BBOARD" SPACE mailbox_bboard
  2057.  
  2058.    body            ::= "(" body_structure ")"
  2059.  
  2060.    body_basic      ::= body_type SPACE body_subtype SPACE body_parameter
  2061.                        SPACE body_id SPACE body_description SPACE
  2062.                        body_encoding SPACE body_size_byte
  2063.  
  2064.    body_description::= nil / string
  2065.  
  2066.    body_encoding   ::= "7BIT" / "8BIT" / "BINARY" / "BASE64"/
  2067.                        "QUOTEDPRINTABLE" / atom
  2068.  
  2069.    body_id         ::= nil / string
  2070.  
  2071.  
  2072.  
  2073.  
  2074. Crispin                                                        [Page 37]
  2075.  
  2076. Internet Draft                  IMAP2bis                 August 13, 1993
  2077.  
  2078.  
  2079.    body_msg        ::= body_basic SPACE envelope SPACE body
  2080.  
  2081.    body_parameter  ::= nil / "(" 1#(string string) ")"
  2082.  
  2083.    body_section    ::= number / number "." body_section
  2084.  
  2085.    body_size_byte  ::= number
  2086.  
  2087.    body_size_line  ::= number
  2088.  
  2089.    body_structure  ::= body_basic / body_msg / body_text /
  2090.                        "(" body_structure ")" SPACE body_subtype
  2091.  
  2092.    body_subtype    ::= nil / string
  2093.  
  2094.    body_text       ::= body_basic SPACE body_size_line
  2095.  
  2096.    body_type       ::= "TEXT" / "MULTIPART" / "MESSAGE" / "APPLICATION" /
  2097.                        "AUDIO" / "IMAGE" / "VIDEO" / atom
  2098.  
  2099.    CHAR            ::= <any 7-bit US-ASCII character except NUL, 0x01 - 0x7f>
  2100.  
  2101.    CHAR8           ::= <any 8-bit octet except NUL, 0x01 - 0xff>
  2102.  
  2103.    check           ::= "CHECK"
  2104.  
  2105.    copy            ::= "COPY" SPACE sequence SPACE mailbox
  2106.  
  2107.    CR              ::= <ASCII CR, carriage return, 0x0C>
  2108.  
  2109.    create          ::= "CREATE" SPACE mailbox
  2110.  
  2111.    CRLF            ::= CR LF
  2112.  
  2113.    CTL             ::= <any ASCII control character and DEL, 0x00 - 0x1f, 0x7f>
  2114.  
  2115.    date            ::= date_new / date_old
  2116.  
  2117.    date_day        ::= 1*2DIGIT
  2118.                        ;; day of month
  2119.  
  2120.    date_month      ::= "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" /
  2121.                        "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
  2122.  
  2123.    date_new        ::= date_day "-" date_month "-" date_year
  2124.  
  2125.    date_old        ::= date_day "-" date_month "-" date_year_old
  2126.                        ;; Obsolete
  2127.  
  2128.  
  2129.  
  2130. Crispin                                                        [Page 38]
  2131.  
  2132. Internet Draft                  IMAP2bis                 August 13, 1993
  2133.  
  2134.  
  2135.    date_year       ::= 4DIGIT / date_year_old
  2136.  
  2137.    date_year_old   ::= 2DIGIT
  2138.                        ;; Obsolete, (year - 1900)
  2139.  
  2140.    date_time       ::= date_time_new / date_time_old
  2141.  
  2142.    date_time_new   ::= date_new SPACE time SPACE zone
  2143.  
  2144.    date_time_old   ::= date_old SPACE time "-" zone_old
  2145.                        ;; Obsolete
  2146.  
  2147.    delete          ::= "DELETE" SPACE mailbox_other
  2148.  
  2149.    DIGIT           ::= <any ASCII decimal digit, 0x30 - 0x39>
  2150.  
  2151.    DIGIT_HEX       :: DIGIT / "a" / "b" / "c" / "d" / "e" / "f"
  2152.  
  2153.    envelope        ::= "(" env_date SPACE env_subject SPACE env_from SPACE
  2154.                        env_sender SPACE env_reply-to SPACE env_to SPACE
  2155.                        env_cc SPACE env_bcc SPACE env_in-reply-to SPACE
  2156.                        env_message-id ")"
  2157.  
  2158.    env_bcc         ::= nil / "(" 1*address ")"
  2159.  
  2160.    env_cc          ::= nil / "(" 1*address ")"
  2161.  
  2162.    env_date        ::= string
  2163.  
  2164.    env_from        ::= nil / "(" 1*address ")"
  2165.  
  2166.    env_in-reply-to ::= nil / string
  2167.  
  2168.    env_message-id  ::= nil / string
  2169.  
  2170.    env_reply-to    ::= nil / "(" 1*address ")"
  2171.  
  2172.    env_sender      ::= nil / "(" 1*address ")"
  2173.  
  2174.    env_subject     ::= nil / string
  2175.  
  2176.    env_to          ::= nil / "(" 1*address ")"
  2177.  
  2178.    examine         ::= "EXAMINE" SPACE mailbox
  2179.  
  2180.    expunge         ::= "EXPUNGE"
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186. Crispin                                                        [Page 39]
  2187.  
  2188. Internet Draft                  IMAP2bis                 August 13, 1993
  2189.  
  2190.  
  2191.    fetch           ::= "FETCH" SPACE sequence SPACE ("ALL" / "FULL" /
  2192.                        "FAST" / fetch_att / "(" 1#fetch_att ")")
  2193.  
  2194.    fetch_att       ::= fetch_att_other / fetch_att_text
  2195.  
  2196.    fetch_att_other ::= "BODY" / "ENVELOPE" / "FLAGS" / "INTERNALDATE" /
  2197.                        "RFC822.SIZE" / "UID"
  2198.  
  2199.    fetch_att_text  ::= "BODY[" body_section "]" / "RFC822" /
  2200.                        "RFC822.HEADER" /
  2201.                        "RFC822.HEADER.LINES" SPACE header_line_list /
  2202.                        "RFC822.HEADER.LINES.NOT" SPACE header_line_list /
  2203.                        "RFC822.TEXT"
  2204.  
  2205.    find            ::= find_mailbox / find_bboard
  2206.  
  2207.    find_bboard     ::= find_bboards / find_boards_all
  2208.  
  2209.    find_bboards    ::= "FIND" SPACE "BBOARDS" SPACE find_pattern
  2210.  
  2211.    find_bboards_all
  2212.                    ::= "FIND" SPACE "ALL.BBOARDS" SPACE find_pattern
  2213.  
  2214.    find_mailbox    ::= find_mailboxes / find_mailboxes_all
  2215.  
  2216.    find_mailboxes  ::= "FIND" SPACE "MAILBOXES" SPACE find_pattern
  2217.  
  2218.    find_mailboxes_all
  2219.                    ::= "FIND" SPACE "ALL.MAILBOXES" SPACE find_pattern
  2220.  
  2221.    find_pattern    ::= astring
  2222.                        ;; includes find_wildcards
  2223.  
  2224.    find_wildcards  ::= "%" / "?" / "*"
  2225.  
  2226.    flag            ::= user_flag / system_flag
  2227.  
  2228.    flag_list       ::= "(" 1#flag ")"
  2229.  
  2230.    flags           ::= 1#flag / flag_list
  2231.  
  2232.    greeting        ::= "*" SPACE (human_data / "PREAUTH" SPACE response_text)
  2233.  
  2234.    header_line     ::= string
  2235.  
  2236.    header_line_list ::= "(" 1#header_line ")"
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242. Crispin                                                        [Page 40]
  2243.  
  2244. Internet Draft                  IMAP2bis                 August 13, 1993
  2245.  
  2246.  
  2247.    human_data      ::= "OK" SPACE response_text / "NO" SPACE response_text /
  2248.                        "BAD" SPACE response_text / "BYE" SPACE resonse_text
  2249.  
  2250.    inbox           ::= "INBOX"
  2251.                        ;; case-independent, but SHOULD be upper-case
  2252.  
  2253.    istring         ::= astring
  2254.                        ;; possible RFC 1342 format data
  2255.  
  2256.    kerberos_authenticator
  2257.                    ::= 1*DIGIT_HEX
  2258.  
  2259.    kerberos_response
  2260.                    ::= 1*DIGIT_HEX
  2261.  
  2262.    LF              ::= <ASCII LF, line feed, 0x0A>
  2263.  
  2264.    literal         ::= "{" number "}" CRLF 1*CHAR8
  2265.                        ;; The number represents the number of CHAR8 octets.
  2266.  
  2267.    login           ::= "LOGIN" SPACE userid SPACE password
  2268.  
  2269.    logout          ::= "LOGOUT"
  2270.  
  2271.    mailbox         ::= inbox / mailbox_other
  2272.  
  2273.    mailbox_bboard  ::= astring
  2274.                        ;; May not be INBOX (in any case).  Should not
  2275.                        ;; include find_wildcards.  May be case-dependent
  2276.                        ;; as a function of server implementation.  May
  2277.                        ;; be a different namespace from mailbox_other.
  2278.  
  2279.    mailbox_other   ::= astring
  2280.                        ;; May not be INBOX (in any case).  Should not
  2281.                        ;; include find_wildcards.  May be case-dependent
  2282.                        ;; as a function of server implementation
  2283.  
  2284.    mailbox_data    ::= "MAILBOX" SPACE mstring / "BBOARD" SPACE mstring /
  2285.                         "SEARCH" SPACE 1#number / "FLAGS" SPACE flag_list
  2286.  
  2287.    message_data    ::= number SPACE (msg_exists / msg_recent / msg_expunge /
  2288.                        msg_fetch / msg_obsolete)
  2289.  
  2290.    msg_copy        ::= "COPY"
  2291.                        ;; Obsolete
  2292.  
  2293.    msg_exists      ::= "EXISTS"
  2294.  
  2295.  
  2296.  
  2297.  
  2298. Crispin                                                        [Page 41]
  2299.  
  2300. Internet Draft                  IMAP2bis                 August 13, 1993
  2301.  
  2302.  
  2303.    msg_expunge     ::= "EXPUNGE"
  2304.  
  2305.    msg_fetch       ::= "FETCH" SPACE "(" 1#("BODY" SPACE body /
  2306.                        "BODY[" body_section "]" string /
  2307.                        "ENVELOPE" SPACE envelope /
  2308.                        "FLAGS" SPACE "(" 1#(recent_flag / flag) ")" /
  2309.                        "INTERNALDATE" SPACE date_time /
  2310.                        "RFC822" SPACE string /
  2311.                        "RFC822.HEADER" SPACE string /
  2312.                        "RFC822.SIZE" SPACE number /
  2313.                        "RFC822.TEXT" SPACE string /
  2314.                        "UID" SPACE uniqueid) ")"
  2315.  
  2316.    msg_obsolete    ::= msg_copy / msg_store
  2317.                        ;; Obsolete unsolicited data responses
  2318.  
  2319.    msg_recent      ::= "RECENT"
  2320.  
  2321.    msg_store       ::= "STORE" SPACE "(" 1#("FLAGS" SPACE
  2322.                        "(" 1#(recent_flag / flag) "))"
  2323.                        ;; Obsolete
  2324.  
  2325.    mstring         ::= text_line
  2326.                        ;; Represents a mailbox
  2327.  
  2328.    nil             ::= "NIL"
  2329.  
  2330.    noop            ::= "NOOP"
  2331.  
  2332.    number          ::= 1*DIGIT
  2333.  
  2334.    partial         ::= "PARTIAL" SPACE number SPACE fetch_att_text SPACE
  2335.                        number SPACE number
  2336.  
  2337.    password        ::= astring / "@KERBEROS:" kerberos_authenticator
  2338.  
  2339.    QCHAR           ::= <any CHAR except qspecials, CR, and LF>
  2340.  
  2341.    qspecials       ::= <"> / "%" / "\"
  2342.  
  2343.    quoted_string   ::= <"> *QCHAR <">
  2344.  
  2345.    recent_flag     ::= "\RECENT"
  2346.  
  2347.    ready           ::= "+" SPACE response_text
  2348.  
  2349.    rename          ::= "RENAME" SPACE mailbox SPACE mailbox_other
  2350.  
  2351.  
  2352.  
  2353.  
  2354. Crispin                                                        [Page 42]
  2355.  
  2356. Internet Draft                  IMAP2bis                 August 13, 1993
  2357.  
  2358.  
  2359.    request         ::= tag SPACE (noop / login / logout / create /
  2360.                        delete / rename / find / subscribe / unsubscribe /
  2361.                        select / examine / bboard / check / expunge /
  2362.                        copy / append / fetch / partial / store / uid /
  2363.                        search / x_command ) CRLF
  2364.  
  2365.    response        ::= tag SPACE ("OK" / "NO" / "BAD") SPACE response_text CRLF
  2366.  
  2367.    response_code   ::= "PARSE" / "READ-ONLY" / "READ-WRITE" / "TRYCREATE" /
  2368.                        "X" atom / kerberos_response
  2369.  
  2370.    response_text   ::= ("[" response_code "]" text_line) / text_line
  2371.  
  2372.    search          ::= "SEARCH" SPACE 1#("ALL" / "ANSWERED" /
  2373.                        "BCC" SPACE istring / "BEFORE" SPACE day /
  2374.                        "BODY" SPACE istring / "CC" SPACE istring / "DELETED" /
  2375.                        "FLAGGED" / "KEYWORD" SPACE atom / "NEW" / "OLD" /
  2376.                        "ON" SPACE day / "RECENT" / "SEEN" /
  2377.                        "SINCE" SPACE day / "TEXT" SPACE istring /
  2378.                        "TO" SPACE istring / "UNANSWERED" / "UNDELETED" /
  2379.                        "UNFLAGGED" / "UNKEYWORD" / "UNSEEN")
  2380.  
  2381.    select          ::= "SELECT" SPACE mailbox
  2382.  
  2383.    sequence        ::= number / (sequence "," sequence) / (number ":" number)
  2384.                        ;; identifies a set of messages by consecutive numbers
  2385.                        ;; from 1 to the number of messages in the mailbox.
  2386.                        ;; Comma delimits individual numbers, colon delimits
  2387.                        ;; between two numbers inclusive.
  2388.                        ;; Example: 2,4:7,9,12:15 is 2,4,5,6,7,9,12,13,14,15
  2389.  
  2390.    SPACE           ::= <ASCII SP, space, 0x20>
  2391.  
  2392.    specials        ::= "{" / qspecials
  2393.  
  2394.    store           ::= "STORE" SPACE sequence SPACE store_att
  2395.  
  2396.    store_att       ::= "+FLAGS" SPACE flags / "-FLAGS" SPACE flags /
  2397.                        "FLAGS" SPACE flags
  2398.  
  2399.    string          ::= quoted_string / literal
  2400.  
  2401.    subscribe       ::= subscribe_mailbox / subscribe_bboard
  2402.  
  2403.    subscribe_bboard
  2404.                    ::= "SUBSCRIBE" SPACE "BBOARD" SPACE mailbox_bboard
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410. Crispin                                                        [Page 43]
  2411.  
  2412. Internet Draft                  IMAP2bis                 August 13, 1993
  2413.  
  2414.  
  2415.    subscribe_mailbox
  2416.                    ::= "SUBSCRIBE" SPACE "MAILBOX" SPACE mailbox
  2417.  
  2418.    system_flag     ::= "\ANSWERED" / "\FLAGGED" / "\DELETED" / "\SEEN"
  2419.  
  2420.    tag             ::= atom
  2421.  
  2422.    text_line       ::= 1*<any CHAR except CR and LF>
  2423.  
  2424.    time            ::= 2DIGIT ":" 2DIGIT ":" 2DIGIT
  2425.                        ;; hours minutes seconds
  2426.  
  2427.    uid             ::= "UID" SPACE (uid_after / uid_before / copy /
  2428.                        fetch / store)
  2429.                        ;; uniqueids used instead of message numbers
  2430.  
  2431.    uid_after       ::= "AFTER" SPACE uniqueid
  2432.  
  2433.    uid_before      ::= "BEFORE" SPACE uniqueid
  2434.  
  2435.    uniqueid        ::= number
  2436.                        ;;; strictly ascending
  2437.  
  2438.    unsolicited     ::= "*" SPACE (human_data / mailbox_data /
  2439.                        message_data) CRLF
  2440.  
  2441.    unsubscribe     ::= unsubscribe_mailbox / unsubscribe_bboard
  2442.  
  2443.    unsubscribe_bboard
  2444.                    ::= "UNSUBSCRIBE" SPACE "BBOARD" SPACE mailbox_bboard
  2445.  
  2446.    unsubscribe_mailbox
  2447.                    ::= "UNSUBSCRIBE" SPACE "MAILBOX" SPACE mailbox_mailbox
  2448.  
  2449.    userid          ::= astring
  2450.  
  2451.    user_flag       ::= atom
  2452.  
  2453.    x_command       ::= "X" atom <optional arguments>
  2454.                        ;; experimental expansion commands
  2455.  
  2456.    zone            ::= ("+" / "-") 4DIGIT
  2457.                        ;; Signed four-digit value of hhmm representing
  2458.                        ;; hours and minutes west of Greenwich (that is,
  2459.                        ;; (the amount that the given time differs from
  2460.                        ;; Universal Time).  Subtracting the timezone
  2461.                        ;; from the given time will give the UT form.
  2462.                        ;; The Universal Time zone is "+0000".
  2463.  
  2464.  
  2465.  
  2466. Crispin                                                        [Page 44]
  2467.  
  2468. Internet Draft                  IMAP2bis                 August 13, 1993
  2469.  
  2470.  
  2471.    zone_old        ::= "UT" / "GMT" / "Z" /                ;; +0000
  2472.                        "AST" / "EST" / "CST" / "MST" /     ;; -0400 to -0700
  2473.                        "PST" / "YST" / "HST" / "BST" /     ;; -0800 to -1100
  2474.                        "ADT" / "EDT" / "CDT" / "MDT" /     ;; -0300 to -0600
  2475.                        "PDT" / "YDT" / "HDT" / "BDT" /     ;; -0700 to -1000
  2476.                        "A" / "B" / "C" / "D" / "E" / "F" / ;; +0100 to +0600
  2477.                        "G" / "H" / "I" / "K" / "L" / "M" / ;; +0700 to +1200
  2478.                        "N" / "O" / "P" / "Q" / "R" / "S" / ;; -0100 to -0600
  2479.                        "T" / "U" / "V" / "W" / "X" / "Y"   ;; -0700 to -1200
  2480.                        ;; Obsolete
  2481.  
  2482.    A protocol session is as follows:
  2483.  
  2484.     Server: greeting
  2485.     *<Client: request (first part, if it contains a literal)
  2486.       *<Server: ready
  2487.         Client: request (next part)
  2488.        >
  2489.       Server: *<unsolicited>
  2490.       Server: response
  2491.      >
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522. Crispin                                                        [Page 45]
  2523.  
  2524. Internet Draft                  IMAP2bis                 August 13, 1993
  2525.  
  2526.  
  2527. Acknowledgements
  2528.  
  2529.    Bill Yeager and Rich Acuff contributed invaluable suggestions in the
  2530.    evolution of IMAP2 from the original IMAP.  James Rice pointed out
  2531.    several ambiguities in the previous IMAP2 specification.
  2532.  
  2533.    My colleagues on the Pine team -- Steve Hubert, Laurence Lundblade,
  2534.    David Miller, and Mike Seibel -- worked long and hard to create a
  2535.    fantastic email user agent with worldwide popularity.  Without their
  2536.    efforts, IMAP2 would have languished in obscurity.  Terry Gray, our
  2537.    boss, provided much-needed moral support and guidance, while refusing
  2538.    to let us get away with "good enough" when "great" was possible.
  2539.  
  2540.    The present protocol would not have come into existance without the
  2541.    assistance of the IETF IMAP2 working group, and in particular Ned
  2542.    Freed, John Myers, Chris Newman, and Adam Treister.
  2543.  
  2544.    Any mistakes, flaws, or sins of omission in this IMAP2bis protocol
  2545.    specification are, however, strictly my own; and the mention of any
  2546.    name above does not imply an endorsement.
  2547.  
  2548. Security Considerations
  2549.  
  2550.    Security issues are discussed in this memo only as far as
  2551.    authentication for the purpose of accessing a server are concerned.
  2552.  
  2553. Author's Address
  2554.  
  2555.    Mark R. Crispin
  2556.    Networks and Distributed Computing, JE-30
  2557.    University of Washington
  2558.    Seattle, WA  98195
  2559.  
  2560.    Phone: (206) 543-5762
  2561.  
  2562.    EMail: MRC@CAC.Washington.EDU
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578. Crispin                                                        [Page 46]
  2579.